package cn.singleton;

/**
 * 静态内部类
 * @auth wzy
 * @date 2023/11/4 9:30
 */

public class TaoFactory {

    private TaoFactory() {
        System.out.println("创建TaoFactory");
    }

    private static TaoFactory waFactory;

    public static TaoFactory getInstance(){
        if (waFactory==null){
            waFactory = TaoFactoryHelper.waFactory;
        }
        return waFactory;
    }


    private static class TaoFactoryHelper{

        private static TaoFactory waFactory = new TaoFactory();
    }


}
